524cd7
@@ -424,11 +424,8 @@
private int computeBucketNumber(Object row, int numBuckets) throws HiveException
       }
     }
 
-    if (buckNum < 0) {
-      buckNum = -1 * buckNum;
-    }
-
-    return buckNum % numBuckets;
+    // similar to hive's default partitioner, refer DefaultHivePartitioner
+    return (buckNum & Integer.MAX_VALUE) % numBuckets;
   }
 
   private void populateCachedDistributionKeys(Object row, int index) throws HiveException {
